﻿package {
	import org.flixel.FlxSprite;
	
	public class Explosion extends FlxSprite {
		public static const anim_name:String = "explode";
		
		public function Explosion(resource:Class) {
			super(0, 0);
			visible = false;
			loadGraphic(resource, true);
		}

		public function explode(x:int, y:int):void {
			this.x = x;
			this.y = y;
			visible = true;
			play(anim_name,true);
		}
		
		override public function update():void {
			super.update();
			if (finished)
				visible = false;
		}
	}
}